﻿<Page
    x:Class="HDK.Demo.BlankPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:HDK.Demo"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">
    <UserControl.Resources>

        <!-- Collection of items displayed by this page -->
        <CollectionViewSource
            x:Name="itemsViewSource"
            Source="{Binding}"/>

        <DataTemplate x:Key="FeedItemTemplate">
            <Grid HorizontalAlignment="Left" Width="250" Height="250">
                <Border Background="{StaticResource ListViewItemPlaceholderRectBrush}">
                    <FlipView ItemsSource="{Binding Images}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                        <FlipView.ItemTemplate>
                            <DataTemplate>
                                <FlipViewItem>
                                    <Image Stretch="UniformToFill" Opacity="0.7">
                                        <Image.Source>
                                            <BitmapImage UriSource="{Binding}" DecodePixelHeight="250" DecodePixelWidth="250" />
                                        </Image.Source>
                                    </Image>
                                </FlipViewItem>
                            </DataTemplate>
                        </FlipView.ItemTemplate>
                        <FlipView.ItemsPanel>
                            <ItemsPanelTemplate>
                                <VirtualizingStackPanel x:Name="OuterItemsPanel" Background="Transparent" Orientation="Horizontal"/>
                            </ItemsPanelTemplate>
                        </FlipView.ItemsPanel>
                    </FlipView>
                </Border>
                <StackPanel VerticalAlignment="Bottom" Background="{StaticResource ListViewItemOverlayBackgroundBrush}">
                    <TextBlock Text="{Binding Title}" Foreground="{StaticResource ListViewItemOverlayTextBrush}" Style="{StaticResource TitleTextStyle}" Height="60" Margin="15,0,15,0"/>
                    <TextBlock Text="{Binding Subtitle}" Foreground="{StaticResource ListViewItemOverlaySecondaryTextBrush}" Style="{StaticResource CaptionTextStyle}" TextWrapping="NoWrap" Margin="15,0,15,10"/>
                </StackPanel>
            </Grid>
        </DataTemplate>

    </UserControl.Resources>
    <Grid Background="{StaticResource ApplicationPageBackgroundBrush}">
    <GridView
                x:Name="itemGridView"
                Grid.Row="1"
                SelectionMode="None"
                AutomationProperties.AutomationId="ItemsGridView"
                AutomationProperties.Name="Items"
                ItemsSource="{Binding Source={StaticResource itemsViewSource}}"
                ItemTemplate="{StaticResource FeedItemTemplate}">
    </GridView>

    </Grid>
</Page>
